<!DOCTYPE html>
<html lang="zh-cn">
   <head>
      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>{$CONF['mallTitle']}后台管理中心</title>
      <link href="__PUBLIC__/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
      <link href="__CSS__/AdminLTE.css" rel="stylesheet" type="text/css" />
      <!--[if lt IE 9]>
      <script src="__PUBLIC__/js/html5shiv.min.js"></script>
      <script src="__PUBLIC__/js/respond.min.js"></script>
      <![endif]-->
      <script src="__PUBLIC__/js/jquery.min.js"></script>
      <script src="__PUBLIC__/plugins/bootstrap/js/bootstrap.min.js"></script>
      <script src="__PUBLIC__/js/common.js"></script>
      <script src="__PUBLIC__/plugins/plugins/plugins.js"></script>
   </head>
   <script>
   function del(id){
	   Plugins.confirm({title:'信息提示',content:'您确定要删除该广告吗?',okText:'确定',cancelText:'取消',okFun:function(){
		   Plugins.closeWindow();
		   Plugins.waitTips({title:'信息提示',content:'正在操作，请稍后...'});
		   $.post("{:U('Admin/Ads/del')}",{id:id},function(data,textStatus){
					var json = WST.toJson(data);
					if(json.status=='1'){
						Plugins.setWaitTipsMsg({content:'操作成功',timeout:1000,callback:function(){
						   location.reload();
						}});
					}else{
						Plugins.closeWindow();
						Plugins.Tips({title:'信息提示',icon:'error',content:'操作失败!',timeout:1000});
					}
				});
	   }});
   }
   </script>
   <body class='wst-page'>
   	<div style="padding-top: 6px;">
       <div class='wst-tbar' style='height:25px;'>
       <form method='post' action='{:U("Admin/Ads/index")}' autocomplete="off">
   		<div style="float:left;width:950px;">
		  广告位置：<select name="adPositionId">
                <option value=''>请选择</option>
                <option value='-1' <if condition="$params['adPositionId'] == -1 ">selected</if>>首页主广告</option>
                <!-- <option value='-4' >首页副广告</option>
                <option value='-5' >首页商城头条</option>
                <option value='-2' >品牌汇广告</option>
                <option value='-3' >店铺街广告</option> -->
                <volist name="goodsCatList" id="vo">
                <option value='{$vo['catId']}' <if condition="$params['adPositionId'] == $vo['catId'] ">selected</if>>(商品分类){$vo['catName']}</option>
                </volist>
             </select>
                      广告标题：<input type='text' name='adName' value='{$params[adName]}' autocomplete="off"/>
  		<button type="submit" class="btn btn-primary glyphicon glyphicon-search">查询</button>
		  </form>
       	</div>
		   <div class='wst-tbar' style='text-align:right;height:25px;'>
	       <php>if(in_array('gggl_01',$WST_STAFF['grant'])){</php>
	       <a type="button" class="btn btn-success glyphicon glyphicon-plus" href='{:U("Admin/Ads/toEdit")}' style='float:right'>新增</a>
	       <php>}</php>
	       </div>
	       <div style="clear:both;"></div>
       </div>

       <div class="wst-body">
        <table class="table table-hover table-striped table-bordered wst-list">
           <thead>
             <tr>
               <th width='40'>序号</th>
               <th>广告标题</th>
               <th>广告位置</th>
               <th>PC跳转网址</th>
               <th>APP跳转</th>
               <th>广告日期</th>
               <th>所属地区</th>
               <th width='80'>图标</th>
               <th width='80'>点击数</th>
               <th width='150'>操作</th>
             </tr>
           </thead>
           <tbody>
            <volist name="Page['root']" id="vo" key='i'>
             <tr>
               <td>{$i}</td>
               <td>{$vo['adName']}</td>
               <td>
               <if condition="$vo['adPositionId'] == -1 ">首页主广告
               <elseif condition="$vo['adPositionId'] == -2 "/>品牌汇广告
               <elseif condition="$vo['adPositionId'] == -3 "/>店铺街广告
               <elseif condition="$vo['adPositionId'] == -4 "/>首页副广告
               <elseif condition="$vo['adPositionId'] == -5 "/>首页商城头条
               <elseif condition="$vo['adPositionId'] == 0 "/>微帮
               <elseif condition="$vo['adPositionId'] == 1 "/>云购
               <elseif condition="$vo['adPositionId'] == 2 "/>积分商城
               <elseif condition="$vo['adPositionId'] == 3 "/>新店来袭
              </if>
               </td>
               <td>{$vo['adURL']}</td>
               <td>{$vo['adURLApp']}</td>
               <td>{$vo['adStartDate']}至{$vo['adEndDate']}</td>
               <td>{$vo['areaName1']}{$vo['areaName2']}</td>
               <td><img src='__ROOT__/{$vo['adFile']}' width='60' height='30'></td>
               <td>{$vo['adClickNum']}</td>
               <td>
               <a class="btn btn-default glyphicon glyphicon-pencil" href='{:U("Admin/Ads/toEdit",array('id'=>$vo['adId']))}'>修改</a>&nbsp;
               <a class="btn btn-default glyphicon glyphicon-trash" onclick="javascript:del({$vo['adId']})">刪除</a>
               </td>
             </tr>
             </volist>
             <tr>
                <td colspan='9' align='center'>{$Page['pager']}</td>
             </tr>
           </tbody>
        </table>
       </div>
   </body>
</html>